<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=0.85, maximum-scale=1.5">
<title>积分明细</title>
<link rel="stylesheet" href="css/layout.css">
</head>

<body>
    
<?php
include_once("base-class.php");

//新建sae数据库类
$mysql = new SaeMysql();

//获取当前页码
$page=intval($_GET["page"]);

//获取操作标识传入
//$action=$_GET["action"];
//$action= string::un_script_code($action);
//$action= string::un_html($action);


//获取员工ID号传入
$roster_id=intval($_GET["id"]);
//列表数据获取、分页

//计算总数
$count=$mysql->getVar("select COUNT(*) from roster,list where roster_name = list_name and $roster_id = roster_id");
//如果数据表里有数据
if($count)
{
    //每页显示记录数
    $page_num = 1000;
    //如果无页码参数则为第一页
    if ($page == 0) $page = 1;
    //计算开始的记录序号
    $from_record = ($page - 1) * $page_num;
    //获取符合条件的数据
    // $list_list=$mysql->getData("select *
    //          from list where $list_name =  $rostar_name
    //          limit $from_record,$page_num");
    
    

        $list_list=$mysql->getData("select list_id,list_name,list_code,gift_item,list_money,list_addtime,list_status,list_checkname,list_checktime
                from roster,list,gift where roster_name = list_name and $roster_id = roster_id and list_code = gift_code and list_status<2 ORDER BY list_addtime DESC limit $from_record,$page_num ");
    //分页函数
    $multi = multi($count, $page_num, $page, "list_list.php");
}
?>

    <!--页面名称-->
	<h3>员工积分明细</h3>
    <!--列表开始-->
    
 
	<?php
        if($list_list)
        {
            
            foreach($list_list as $value)
            {
                
                
                ?>
	<div class="main">
    	<div class="main_left">
            <div class="gift_id">
                <b><?php echo  $value[list_code]; ?></b>
            </div>   
            <div class="gift_code">
            	No.<?php echo  $value[list_id]; ?>
            </div>
        </div>
		<div class="main_right">
			<div class="gift_score">
				<?php echo  $value[list_money]; ?>
			</div>
			<div class="gift_name">
				<?php echo  $value[list_name]; ?>
				
			</div>
		</div>
        <div class="main_middle">
        	<div class="gift_item">
            	<nobr><?php echo  $value[gift_item]; ?></nobr>
            </div>
            <div class="time">	
                <div class="add_time">
                    添加:<?php $value[list_addtime]=strtotime($value[list_addtime]);
					echo  date("Y-m-d",$value[list_addtime]); ?>
                </div>
                <?php if($value["list_status"]) {?>
                <div class="check_time">
                    审核: <?php echo  $value[list_checkname]; ?><?php $value[list_checktime]=strtotime($value[list_checktime]);
					echo  date("Y-m-d",$value[list_checktime]); ?>
                </div>
            </div>
			
			
                
                <div class="pass">
                    <?php echo '<img src="img/pass.png" width="90" height="75" />';
				}?>
                </div>
            
            
        </div>  
    </div>       
   
				
				<?php
            }
        }
        else
        {
            echo "<tr><td colspan=7>无记录</td></tr>";
        }
    ?>
    
    </table>
        <div style="font-size:40px">
        
    <?php
	echo $multi;
    ?>
    </div>
</body>
</html>
